"\nRCS5AP1 as modified for TOS by Allan Pratt, atari!apratt\nrcs usage: rcs -alogins -Aoldfile -{blu}[rev] -cstring -e[logins] -i -{LU} -{nN}name[:rev] -orange -sstate[:rev] -t[textfile] -Vn file ...";
const char *branchsym, *commsyml, *textfile;
int branchflag, expmode, initflag;
int r, strictlock, strict_selected, textflag;
mode_t defaultRCSmode; /* default mode for new RCS files */
struct buf branchnum;
struct Lockrev *curlock, * rmvlock, *lockpt;
struct Status * curstate;
initid();
catchints();
nextchaccess = &chaccess;
branchsym = commsyml = textfile = nil;
branchflag = strictlock = false;
bufautobegin(&branchnum);
curlock = rmvlock = nil;
defaultRCSmode = 0;
expmode = -1;
initflag= textflag = false;
strict_selected = 0;
/* preprocessing command options */
while (--argc,++argv, argc>=1 && ((*argv)[0] == '-')) {
switch ((*argv)[1]) {
case 'i': /* initial version */
initflag = true;
break;
case 'b': /* change default branch */
if (branchflag) redefined('b');
branchflag= true;
branchsym = (*argv)+2;
break;
case 'c': /* change comment symbol */
if (commsyml) redefined('c');
commsyml = (*argv)+2;
break;
case 'a': /* add new accessor */
getaccessor(*argv+1, append);
break;
case 'A': /* append access list according to accessfile */
*argv += 2;
if (!**argv) {
error("missing file name after -A");
break;
}
if (0 < pairfilenames(1,argv,rcsreadopen,true,false)) {
while (AccessList) {
getchaccess(strsave(AccessList->login), append);
AccessList = AccessList->nextaccess;
}
ffclose(finptr);
}
break;
case 'e': /* remove accessors */
getaccessor(*argv+1, erase);
break;
case 'l': /* lock a revision if it is unlocked */
if ( (*argv)[2] == '\0'){ /* lock head or def. branch */
lockhead = true;
break;
}
lockpt = talloc(struct Lockrev);
lockpt->revno = (*argv)+2;
lockpt->nextrev = nil;
if ( curlock )
curlock->nextrev = lockpt;
else
newlocklst = lockpt;
curlock = lockpt;
break;
case 'u': /* release lock of a locked revision */
if ( (*argv)[2] == '\0'){ /* unlock head */
unlockcaller=true;
break;
}
lockpt = talloc(struct Lockrev);
lockpt->revno = (*argv)+2;
lockpt->nextrev = nil;
if (rmvlock)
rmvlock->nextrev = lockpt;
else
rmvlocklst = lockpt;
rmvlock = lockpt;
curlock = rmnewlocklst(lockpt);
break;
case 'L': /* set strict locking */
if (strict_selected++) { /* Already selected L or U? */
if (!strictlock) /* Already selected -U? */
warn("-L overrides -U.");
}
strictlock = true;
break;
case 'U': /* release strict locking */
if (strict_selected++) { /* Already selected L or U? */
if (strictlock) /* Already selected -L? */
warn("-L overrides -U.");
}
else
strictlock = false;
break;
case 'n': /* add new association: error, if name exists */
if ( (*argv)[2] == '\0') {
error("missing symbolic name after -n");
break;
}
getassoclst(false, (*argv)+1);
break;
case 'N': /* add or change association */
if ( (*argv)[2] == '\0') {
error("missing symbolic name after -N");
break;
}
getassoclst(true, (*argv)+1);
break;
case 'o': /* delete revisions */
if (delrev.strt) redefined('o');
if ( (*argv)[2] == '\0' ) {
error("missing revision range after -o");
break;
}
getdelrev( (*argv)+1 );
break;
case 's': /* change state attribute of a revision */